/*
 * listener.js
 */

var iForumListener = {
	_log : new Logger("iForumListener"),

	STATE_START : Components.interfaces.nsIWebProgressListener.STATE_START,
	STATE_STOP : Components.interfaces.nsIWebProgressListener.STATE_STOP,
	STATE_IS_WINDOW : Components.interfaces.nsIWebProgressListener.STATE_IS_WINDOW,

	QueryInterface : function(aIID) {
		if (aIID.equals(Components.interfaces.nsIWebProgressListener)
				|| aIID.equals(Components.interfaces.nsISupportsWeakReference)
				|| aIID.equals(Components.interfaces.nsISupports))
			return this;
		throw Components.results.NS_NOINTERFACE;
	},

	onStateChange : function(aProgress, aRequest, aFlag, aStatus) {
		try {
			if ((aFlag & this.STATE_START) && (aFlag & this.STATE_IS_WINDOW)) {
			}
			if ((aFlag & this.STATE_STOP) && (aFlag & this.STATE_IS_WINDOW)) {
				var url = aProgress.DOMWindow.document.location.href + "";
				ScraperController.loadComplete();
			}
		} catch (e) {
			this._log.error("discover possible sources: " + e);
		}
	},

	onLocationChange : function(aProgress, aRequest, aURI) {
	},

	onProgressChange : function() {
		return 0;
	},
	onStatusChange : function() {
		return 0;
	},
	onSecurityChange : function() {
		return 0;
	},
	onLinkIconAvailable : function() {
		return 0;
	}
};
